Optimal. Leaf size=86 \[ -\frac {(e f-d g)^2}{2 d e^3 (d+e x)}-\frac {(e f+d g)^2 \log (d-e x)}{4 d^2 e^3}+\frac {(e f-d g) (e f+3 d g) \log (d+e x)}{4 d^2 e^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {862, 90}
\begin {gather*} \frac {(3 d g+e f) (e f-d g) \log (d+e x)}{4 d^2 e^3}-\frac {(d g+e f)^2 \log (d-e x)}{4 d^2 e^3}-\frac {(e f-d g)^2}{2 d e^3 (d+e x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 862
Rubi steps
\begin {align*} \int \frac {(f+g x)^2}{(d+e x) \left (d^2-e^2 x^2\right )} \, dx &=\int \frac {(f+g x)^2}{(d-e x) (d+e x)^2} \, dx\\ &=\int \left (\frac {(e f+d g)^2}{4 d^2 e^2 (d-e x)}+\frac {(-e f+d g)^2}{2 d e^2 (d+e x)^2}+\frac {(e f-d g) (e f+3 d g)}{4 d^2 e^2 (d+e x)}\right ) \, dx\\ &=-\frac {(e f-d g)^2}{2 d e^3 (d+e x)}-\frac {(e f+d g)^2 \log (d-e x)}{4 d^2 e^3}+\frac {(e f-d g) (e f+3 d g) \log (d+e x)}{4 d^2 e^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 82, normalized size = 0.95 \begin {gather*} \frac {-(e f+d g)^2 (d+e x) \log (d-e x)+(e f-d g) (2 d (-e f+d g)+(e f+3 d g) (d+e x) \log (d+e x))}{4 d^2 e^3 (d+e x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 112, normalized size = 1.30
method | result | size |
default | \(\frac {\left (-3 d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (e x +d \right )}{4 d^{2} e^{3}}-\frac {d^{2} g^{2}-2 d e f g +e^{2} f^{2}}{2 e^{3} d \left (e x +d \right )}+\frac {\left (-d^{2} g^{2}-2 d e f g -e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{4 d^{2} e^{3}}\) | \(112\) |
norman | \(\frac {-d^{2} g^{2}+2 d e f g -e^{2} f^{2}}{2 d \,e^{3} \left (e x +d \right )}-\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{4 e^{3} d^{2}}-\frac {\left (3 d^{2} g^{2}-2 d e f g -e^{2} f^{2}\right ) \ln \left (e x +d \right )}{4 e^{3} d^{2}}\) | \(113\) |
risch | \(-\frac {d \,g^{2}}{2 e^{3} \left (e x +d \right )}+\frac {f g}{e^{2} \left (e x +d \right )}-\frac {f^{2}}{2 e d \left (e x +d \right )}-\frac {3 \ln \left (-e x -d \right ) g^{2}}{4 e^{3}}+\frac {\ln \left (-e x -d \right ) f g}{2 e^{2} d}+\frac {\ln \left (-e x -d \right ) f^{2}}{4 e \,d^{2}}-\frac {\ln \left (e x -d \right ) g^{2}}{4 e^{3}}-\frac {\ln \left (e x -d \right ) f g}{2 e^{2} d}-\frac {\ln \left (e x -d \right ) f^{2}}{4 e \,d^{2}}\) | \(158\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 112, normalized size = 1.30 \begin {gather*} -\frac {{\left (3 \, d^{2} g^{2} - 2 \, d f g e - f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e + d\right )}{4 \, d^{2}} - \frac {{\left (d^{2} g^{2} + 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e - d\right )}{4 \, d^{2}} - \frac {d^{2} g^{2} - 2 \, d f g e + f^{2} e^{2}}{2 \, {\left (d x e^{4} + d^{2} e^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.73, size = 164, normalized size = 1.91 \begin {gather*} -\frac {2 \, d^{3} g^{2} - 4 \, d^{2} f g e + 2 \, d f^{2} e^{2} + {\left (3 \, d^{3} g^{2} - f^{2} x e^{3} - {\left (2 \, d f g x + d f^{2}\right )} e^{2} + {\left (3 \, d^{2} g^{2} x - 2 \, d^{2} f g\right )} e\right )} \log \left (x e + d\right ) + {\left (d^{3} g^{2} + f^{2} x e^{3} + {\left (2 \, d f g x + d f^{2}\right )} e^{2} + {\left (d^{2} g^{2} x + 2 \, d^{2} f g\right )} e\right )} \log \left (x e - d\right )}{4 \, {\left (d^{2} x e^{4} + d^{3} e^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 182 vs.
\(2 (75) = 150\).
time = 0.51, size = 182, normalized size = 2.12 \begin {gather*} - \frac {d^{2} g^{2} - 2 d e f g + e^{2} f^{2}}{2 d^{2} e^{3} + 2 d e^{4} x} - \frac {\left (d g - e f\right ) \left (3 d g + e f\right ) \log {\left (x + \frac {- 2 d^{3} g^{2} + d \left (d g - e f\right ) \left (3 d g + e f\right )}{d^{2} e g^{2} - 2 d e^{2} f g - e^{3} f^{2}} \right )}}{4 d^{2} e^{3}} - \frac {\left (d g + e f\right )^{2} \log {\left (x + \frac {- 2 d^{3} g^{2} + d \left (d g + e f\right )^{2}}{d^{2} e g^{2} - 2 d e^{2} f g - e^{3} f^{2}} \right )}}{4 d^{2} e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.01, size = 116, normalized size = 1.35 \begin {gather*} -\frac {{\left (3 \, d^{2} g^{2} - 2 \, d f g e - f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | x e + d \right |}\right )}{4 \, d^{2}} - \frac {{\left (d^{2} g^{2} + 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | x e - d \right |}\right )}{4 \, d^{2}} - \frac {{\left (d^{3} g^{2} - 2 \, d^{2} f g e + d f^{2} e^{2}\right )} e^{\left (-3\right )}}{2 \, {\left (x e + d\right )} d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.70, size = 109, normalized size = 1.27 \begin {gather*} \frac {\ln \left (d+e\,x\right )\,\left (-3\,d^2\,g^2+2\,d\,e\,f\,g+e^2\,f^2\right )}{4\,d^2\,e^3}-\frac {\ln \left (d-e\,x\right )\,\left (d^2\,g^2+2\,d\,e\,f\,g+e^2\,f^2\right )}{4\,d^2\,e^3}-\frac {d^2\,g^2-2\,d\,e\,f\,g+e^2\,f^2}{2\,d\,e^3\,\left (d+e\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________